{% extends "page_base.html" %}

{% load inventree_extras %}
{% load static %}
{% load i18n %}

{% block page_title %}
{% inventree_title %} | {% trans "Sales Orders" %}
{% endblock %}

{% block breadcrumb_list %}
{% endblock %}

{% block heading %}
{% trans "Sales Orders" %}
{% endblock %}

{% block actions %}
{% if roles.sales_order.add %}
<button class='btn btn-success' type='button' id='so-create' title='{% trans "Create new sales order" %}'>
    <span class='fas fa-plus-circle'></span> {% trans "New Sales Order" %}
</button>
{% endif %}
{% endblock %}

{% block page_info %}

<div class='panel-content'>
    <div id='table-buttons'>
        <div class='button-toolbar container-fluid' style='float: right;'>
            <div class='btn-group'>
                {% include "filter_list.html" with id="salesorder" %}
            </div>
        </div>
    </div>

    <table class='table table-striped table-condensed po-table' data-toolbar='#table-buttons' id='sales-order-table'>
    </table>

    <div id='sales-order-calendar'></div>
</div>

{% endblock %}

{% block js_ready %}
{{ block.super }}

loadSalesOrderTable("#sales-order-table", {
    url: "{% url 'api-so-list' %}",
});

$("#so-create").click(function() {
    createSalesOrder();
});

{% endblock %}
